home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / FWScptbl.cpp bug? < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  776 b   |  [TEXT/ttxt]

  1. Subject:     FWScptbl.cpp bug?
  2. Sent:        6/15/96 8:59 AM
  3. Received:    6/17/96 8:22 AM
  4. From:        Lars Travers, ltravers@igc.apc.org
  5. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  6.  
  7. I made an ODFDraw document devoid of shapes. Then I ran this script:
  8.  
  9. tell application "ODFDraw test"
  10.    set collection to every <<class DrSh>>
  11. end tell
  12.  
  13. It died with an "FRefCount == 1" message. In FWScptbl.cpp, in the method 
  14. GetAllElements:
  15.  
  16.     if (collection->Count() == 0)
  17.     {
  18.         delete collection;
  19.         collection = NULL;
  20.     }
  21.  
  22. I think maybe it should say:
  23.      collection->ReleaseScriptable();
  24. instead of delete collection because collection's FRefCount will
  25. equal 1 at this point, but the destructor for FW_CScriptableCollection wants 
  26. FRefCount == 0.
  27.  
  28. Lars
  29.